/* ==================== 基础样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  /* 调整为更柔和的背景色 */
  color: #333;
  line-height: 1.6;
}

/* ==================== 头部样式 ==================== */
.app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  /* 紫色渐变主题，与工作台保持一致 */
  color: white;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: bold;
}

.divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.2rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: white;
  font-weight: 500;
}

/* ==================== 主容器 ==================== */
.main-container {
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.content-wrapper {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* ==================== 标签页 ==================== */
.page-tabs {
  background: #f5f7fa;
  border-bottom: 1px solid #e4e7ed;
  padding: 5px 20px 0;
  display: flex;
}

.page-tab {
  padding: 8px 15px;
  background: white;
  border: 1px solid #e4e7ed;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 0.9rem;
  color: #409eff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

.page-tab.active {
  border-bottom-color: white;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.filter-item label {
  font-size: 0.9rem;
  color: #606266;
  white-space: nowrap;
}

.filter-item input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  color: #606266;
  width: 200px;
}

.filter-item input:focus {
  border-color: #409eff;
  outline: none;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 5px;
}

.date-range input {
  width: 140px;
}

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  padding: 20px;
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
  background-color: #409eff;
  border-color: #409eff;
  color: white;
  padding: 8px 15px;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: .1s;
}

.btn-primary:hover {
  background-color: #66b1ff;
  border-color: #66b1ff;
}

.btn-secondary {
  background: white;
  border: 1px solid #dcdfe6;
  color: #606266;
  padding: 8px 15px;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: .1s;
}

.btn-secondary:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background-color: #ecf5ff;
}

/* ==================== 操作栏 ==================== */
.action-bar {
  padding: 15px 20px;
}

.new-case-btn {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==================== 案件网格 ==================== */
.cases-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 350px));
  /* 设置最小宽度为300px，最大宽度为350px */
  gap: 15px;
  /* 减小间距 */
  background-color: white;
  /* 改为白色背景，与 content-wrapper 一致 */
  overflow: visible;
  /* 允许卡片菜单溢出 */
}

/* ==================== 案件卡片 ==================== */
.case-card {
  background: white;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: .3s;
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 350px;
  /* 与网格最大宽度保持一致 */
}

/* 当下拉菜单激活时，提高卡片层级 - 由JavaScript控制 */
.case-card.dropdown-active {
  z-index: 100;
}

.case-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #dcdfe6;
}

.card-header {
  padding: 10px 15px;
  border-bottom: 1px solid #f2f6fc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfcfc;
  border-radius: 4px 4px 0 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  /* 防止标题过长溢出 */
  flex: 1;
  /* 允许左侧占据剩余空间 */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.case-name {
  font-size: 0.95rem;
  /* 稍微减小字体 */
  font-weight: bold;
  color: #303133;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lock-icon {
  color: #f56c6c;
  font-size: 0.8rem;
}

.closed-badge {
  background-color: #f56c6c;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-tag {
  padding: 1px 6px;
  /* 减小标签内边距 */
  border-radius: 3px;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.status-tag[data-status="初核"] {
  background-color: #409eff;
}

.status-tag[data-status="留置"] {
  background-color: #e6a23c;
}

.card-body {
  padding: 12px 15px;
  /* 减小内边距 */
  flex: 1;
}

.info-row {
  display: flex;
  margin-bottom: 6px;
  /* 减小行间距 */
  font-size: 0.85rem;
  /* 减小字体 */
  align-items: center;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-row .label {
  color: #909399;
  width: 75px;
  /* 增加宽度防止换行 */
  /* 调整标签宽度 */
  flex-shrink: 0;
  white-space: nowrap;
  /* 强制不换行 */
}

.info-row .value {
  color: #606266;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  padding: 8px 15px;
  /* 减小内边距 */
  border-top: 1px solid #f2f6fc;
  background-color: white;
  border-radius: 0 0 4px 4px;
  overflow: visible;
  /* 确保下拉菜单不被裁剪 */
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: visible;
  /* 确保下拉菜单不被裁剪 */
}

.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #606266;
  padding: 4px 8px;
  /* 调整按钮点击区域 */
  border-radius: 4px;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: #409eff;
  background-color: #ecf5ff;
}

.icon-btn .icon {
  font-size: 1rem;
  /* 减小图标 */
}

.icon-btn .text {
  font-size: 0.7rem;
  /* 减小文字 */
  transform: scale(0.9);
  /* 视觉上更精致 */
}

/* ==================== 下拉菜单 ==================== */
.dropdown {
  position: static;
  /* 使用 static，菜单使用 fixed 定位 */
}

.dropdown-menu {
  display: none;
  position: fixed;
  /* 使用 fixed 避免被任何容器裁剪 */
  background: white;
  border: 1px solid #ebeef5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  padding: 5px 0;
  min-width: 140px;
  z-index: 99999;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 15px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #606266;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: #ecf5ff;
  color: #409eff;
}

/* ==================== 弹窗样式复用 ==================== */
/* 保持原有弹窗样式，稍作调整以匹配新主题 */
.modal-overlay {
  z-index: 2000;
}